package com.example.SpringBoot_demo.service.impl;

import com.example.SpringBoot_demo.bean.User;
import com.example.SpringBoot_demo.mapper.UserMapper;
import com.example.SpringBoot_demo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceimpl implements IUserService {

    @Autowired(required = false)
    private UserMapper userMapper;

    @Override
    public List<User> viewUser() {
        return userMapper.viewUser();
    }

    @Override
    public List<User> viewAdmin() {
        return userMapper.viewAdmin();
    }

    @Override
    public void deleteUser(String userid) {
        userMapper.deleteUser(userid);
    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public User getUserById(String userid) {
        return userMapper.getUserById(userid);
    }

    @Override
    public List<User> getUser(String userid, String username) {
        return userMapper.getUser(userid, username);
    }


}